using System;
using System.Data;
using System.Collections;

namespace APP.QUANLY.Entity
{
    /// <summary>
    /// Summary description for TEMP_HOADONXUATKHO.
    /// </summary>
    public class TEMP_HOADONXUATKHOList : CollectionBase
    {
		private string _ErrMsg;
        public string ErrMsg { get { return _ErrMsg; } }
    	public TEMP_HOADONXUATKHOList()
    	{
	    }

		public void Add(TEMP_HOADONXUATKHO entity)
		{
            this.List.Add(entity);
		}

		public void Add(TEMP_HOADONXUATKHOList list)
		{	
			foreach(TEMP_HOADONXUATKHO entity in list)
			{
				this.Add(entity);
			}
		}
	
		public new virtual Enumerator GetEnumerator()
		{
		    return new Enumerator(this);
		}
		public virtual TEMP_HOADONXUATKHO this[int index]
		{
		    get
			{
				return (TEMP_HOADONXUATKHO)this.List[index];
			}
			set
			{
				this.List[index] = value;
			}
		}

		#region Find Object And List Object
		//---PrimaryKey
	public virtual TEMP_HOADONXUATKHO Find(string MAHOADONXUAT)
	{
	    foreach (TEMP_HOADONXUATKHO obj in this.List)
	    {
		if(obj.MAHOADONXUAT.ToString().ToUpper().Trim() == MAHOADONXUAT.ToString().ToUpper().Trim())
		{
		    obj.IsExisting = true;
		    return obj;
		}
	    }
	    return null;
	}

public virtual TEMP_HOADONXUATKHOList FindListByMAHOADONXUAT(string MAHOADONXUAT)
{
	try
	{
		TEMP_HOADONXUATKHOList List = new TEMP_HOADONXUATKHOList();
		foreach (TEMP_HOADONXUATKHO obj in this.List)
		{
		    if(obj.MAHOADONXUAT.ToString().ToUpper().Trim() == MAHOADONXUAT.ToString().ToUpper().Trim())
		    {
				List.Add(obj);
		    }
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
    	{
		_ErrMsg = ex.Message;
        		return null;
    	}
}
		//---NonPrimaryKey
        public virtual TEMP_HOADONXUATKHO FindByTHANHTIENCHUACK_HD(decimal THANHTIENCHUACK_HD)
        {
	        foreach (TEMP_HOADONXUATKHO obj in this.List)
	        {
		        if(obj.THANHTIENCHUACK_HD.ToString().ToUpper().Trim() == THANHTIENCHUACK_HD.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual TEMP_HOADONXUATKHO FindByTIENCHIETKHAU_HD(decimal TIENCHIETKHAU_HD)
        {
	        foreach (TEMP_HOADONXUATKHO obj in this.List)
	        {
		        if(obj.TIENCHIETKHAU_HD.ToString().ToUpper().Trim() == TIENCHIETKHAU_HD.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual TEMP_HOADONXUATKHO FindByTIENKHUYENMAI_HD(decimal TIENKHUYENMAI_HD)
        {
	        foreach (TEMP_HOADONXUATKHO obj in this.List)
	        {
		        if(obj.TIENKHUYENMAI_HD.ToString().ToUpper().Trim() == TIENKHUYENMAI_HD.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual TEMP_HOADONXUATKHO FindBySOTIENTHANHTOAN_HD(decimal SOTIENTHANHTOAN_HD)
        {
	        foreach (TEMP_HOADONXUATKHO obj in this.List)
	        {
		        if(obj.SOTIENTHANHTOAN_HD.ToString().ToUpper().Trim() == SOTIENTHANHTOAN_HD.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual TEMP_HOADONXUATKHO FindBySOTIENKHACHDUA_HD(decimal SOTIENKHACHDUA_HD)
        {
	        foreach (TEMP_HOADONXUATKHO obj in this.List)
	        {
		        if(obj.SOTIENKHACHDUA_HD.ToString().ToUpper().Trim() == SOTIENKHACHDUA_HD.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual TEMP_HOADONXUATKHO FindByLOAIHOADON(Int32 LOAIHOADON)
        {
	        foreach (TEMP_HOADONXUATKHO obj in this.List)
	        {
		        if(obj.LOAIHOADON.ToString().ToUpper().Trim() == LOAIHOADON.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual TEMP_HOADONXUATKHO FindByHANTHANHTOAN(DateTime HANTHANHTOAN)
        {
	        foreach (TEMP_HOADONXUATKHO obj in this.List)
	        {
		        if(obj.HANTHANHTOAN.ToString().ToUpper().Trim() == HANTHANHTOAN.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual TEMP_HOADONXUATKHO FindByGHICHU_HD(string GHICHU_HD)
        {
	        foreach (TEMP_HOADONXUATKHO obj in this.List)
	        {
		        if(obj.GHICHU_HD.ToString().ToUpper().Trim() == GHICHU_HD.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual TEMP_HOADONXUATKHO FindByDATHANHTOAN(bool DATHANHTOAN)
        {
	        foreach (TEMP_HOADONXUATKHO obj in this.List)
	        {
		        if(obj.DATHANHTOAN.ToString().ToUpper().Trim() == DATHANHTOAN.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual TEMP_HOADONXUATKHO FindByNGUOITAO(string NGUOITAO)
        {
	        foreach (TEMP_HOADONXUATKHO obj in this.List)
	        {
		        if(obj.NGUOITAO.ToString().ToUpper().Trim() == NGUOITAO.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual TEMP_HOADONXUATKHO FindByNGAYTAOHOADON(DateTime NGAYTAOHOADON)
        {
	        foreach (TEMP_HOADONXUATKHO obj in this.List)
	        {
		        if(obj.NGAYTAOHOADON.ToString().ToUpper().Trim() == NGAYTAOHOADON.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual TEMP_HOADONXUATKHO FindByISDELETE(bool ISDELETE)
        {
	        foreach (TEMP_HOADONXUATKHO obj in this.List)
	        {
		        if(obj.ISDELETE.ToString().ToUpper().Trim() == ISDELETE.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual TEMP_HOADONXUATKHO FindByMAKHACHHANG(Guid MAKHACHHANG)
        {
	        foreach (TEMP_HOADONXUATKHO obj in this.List)
	        {
		        if(obj.MAKHACHHANG.ToString().ToUpper().Trim() == MAKHACHHANG.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual TEMP_HOADONXUATKHO FindByMACA(Int32 MACA)
        {
	        foreach (TEMP_HOADONXUATKHO obj in this.List)
	        {
		        if(obj.MACA.ToString().ToUpper().Trim() == MACA.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

public virtual TEMP_HOADONXUATKHOList FindListByTHANHTIENCHUACK_HD(decimal THANHTIENCHUACK_HD)
{
	try
	{
		TEMP_HOADONXUATKHOList List = new TEMP_HOADONXUATKHOList();
		foreach (TEMP_HOADONXUATKHO obj in this.List)
		{
			if(obj.THANHTIENCHUACK_HD.ToString().ToUpper().Trim() == THANHTIENCHUACK_HD.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual TEMP_HOADONXUATKHOList FindListByTIENCHIETKHAU_HD(decimal TIENCHIETKHAU_HD)
{
	try
	{
		TEMP_HOADONXUATKHOList List = new TEMP_HOADONXUATKHOList();
		foreach (TEMP_HOADONXUATKHO obj in this.List)
		{
			if(obj.TIENCHIETKHAU_HD.ToString().ToUpper().Trim() == TIENCHIETKHAU_HD.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual TEMP_HOADONXUATKHOList FindListByTIENKHUYENMAI_HD(decimal TIENKHUYENMAI_HD)
{
	try
	{
		TEMP_HOADONXUATKHOList List = new TEMP_HOADONXUATKHOList();
		foreach (TEMP_HOADONXUATKHO obj in this.List)
		{
			if(obj.TIENKHUYENMAI_HD.ToString().ToUpper().Trim() == TIENKHUYENMAI_HD.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual TEMP_HOADONXUATKHOList FindListBySOTIENTHANHTOAN_HD(decimal SOTIENTHANHTOAN_HD)
{
	try
	{
		TEMP_HOADONXUATKHOList List = new TEMP_HOADONXUATKHOList();
		foreach (TEMP_HOADONXUATKHO obj in this.List)
		{
			if(obj.SOTIENTHANHTOAN_HD.ToString().ToUpper().Trim() == SOTIENTHANHTOAN_HD.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual TEMP_HOADONXUATKHOList FindListBySOTIENKHACHDUA_HD(decimal SOTIENKHACHDUA_HD)
{
	try
	{
		TEMP_HOADONXUATKHOList List = new TEMP_HOADONXUATKHOList();
		foreach (TEMP_HOADONXUATKHO obj in this.List)
		{
			if(obj.SOTIENKHACHDUA_HD.ToString().ToUpper().Trim() == SOTIENKHACHDUA_HD.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual TEMP_HOADONXUATKHOList FindListByLOAIHOADON(Int32 LOAIHOADON)
{
	try
	{
		TEMP_HOADONXUATKHOList List = new TEMP_HOADONXUATKHOList();
		foreach (TEMP_HOADONXUATKHO obj in this.List)
		{
			if(obj.LOAIHOADON.ToString().ToUpper().Trim() == LOAIHOADON.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual TEMP_HOADONXUATKHOList FindListByHANTHANHTOAN(DateTime HANTHANHTOAN)
{
	try
	{
		TEMP_HOADONXUATKHOList List = new TEMP_HOADONXUATKHOList();
		foreach (TEMP_HOADONXUATKHO obj in this.List)
		{
			if(obj.HANTHANHTOAN.ToString().ToUpper().Trim() == HANTHANHTOAN.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual TEMP_HOADONXUATKHOList FindListByGHICHU_HD(string GHICHU_HD)
{
	try
	{
		TEMP_HOADONXUATKHOList List = new TEMP_HOADONXUATKHOList();
		foreach (TEMP_HOADONXUATKHO obj in this.List)
		{
			if(obj.GHICHU_HD.ToString().ToUpper().Trim() == GHICHU_HD.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual TEMP_HOADONXUATKHOList FindListByDATHANHTOAN(bool DATHANHTOAN)
{
	try
	{
		TEMP_HOADONXUATKHOList List = new TEMP_HOADONXUATKHOList();
		foreach (TEMP_HOADONXUATKHO obj in this.List)
		{
			if(obj.DATHANHTOAN.ToString().ToUpper().Trim() == DATHANHTOAN.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual TEMP_HOADONXUATKHOList FindListByNGUOITAO(string NGUOITAO)
{
	try
	{
		TEMP_HOADONXUATKHOList List = new TEMP_HOADONXUATKHOList();
		foreach (TEMP_HOADONXUATKHO obj in this.List)
		{
			if(obj.NGUOITAO.ToString().ToUpper().Trim() == NGUOITAO.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual TEMP_HOADONXUATKHOList FindListByNGAYTAOHOADON(DateTime NGAYTAOHOADON)
{
	try
	{
		TEMP_HOADONXUATKHOList List = new TEMP_HOADONXUATKHOList();
		foreach (TEMP_HOADONXUATKHO obj in this.List)
		{
			if(obj.NGAYTAOHOADON.ToString().ToUpper().Trim() == NGAYTAOHOADON.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual TEMP_HOADONXUATKHOList FindListByISDELETE(bool ISDELETE)
{
	try
	{
		TEMP_HOADONXUATKHOList List = new TEMP_HOADONXUATKHOList();
		foreach (TEMP_HOADONXUATKHO obj in this.List)
		{
			if(obj.ISDELETE.ToString().ToUpper().Trim() == ISDELETE.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual TEMP_HOADONXUATKHOList FindListByMAKHACHHANG(Guid MAKHACHHANG)
{
	try
	{
		TEMP_HOADONXUATKHOList List = new TEMP_HOADONXUATKHOList();
		foreach (TEMP_HOADONXUATKHO obj in this.List)
		{
			if(obj.MAKHACHHANG.ToString().ToUpper().Trim() == MAKHACHHANG.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual TEMP_HOADONXUATKHOList FindListByMACA(Int32 MACA)
{
	try
	{
		TEMP_HOADONXUATKHOList List = new TEMP_HOADONXUATKHOList();
		foreach (TEMP_HOADONXUATKHO obj in this.List)
		{
			if(obj.MACA.ToString().ToUpper().Trim() == MACA.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}
		#endregion
     
		#region Inner Classes
		/// <summary>
		/// Type-specific enumeration class, used by LogCollection.GetEnumerator.
		/// </summary>
		public class Enumerator : IEnumerator
		{
			private IEnumerator wrapped;

			public Enumerator(TEMP_HOADONXUATKHOList collection)
			{
				this.wrapped = ((CollectionBase)collection).GetEnumerator();
			}

			public TEMP_HOADONXUATKHO Current
			{
				get
				{
					return (TEMP_HOADONXUATKHO)(this.wrapped.Current);
				}
			}

			object IEnumerator.Current
			{
				get
				{
					return (TEMP_HOADONXUATKHO)(this.wrapped.Current);
				}
			}

			public bool MoveNext()
			{
				return this.wrapped.MoveNext();
			}

			public void Reset()
			{
				this.wrapped.Reset();
			}
      }
      #endregion  
   }
}